package com.yu.blog.entities.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yu.blog.entities.baseEntity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.validation.annotation.Validated;
import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Validated
@TableName("p_role")
@Schema(description = "角色列表")
public class Role extends BaseEntity implements Serializable {
    @Schema(description = "角色名")
    @TableField("role_name")
    @NotBlank(message = "角色名不能为空")
    private String roleName;
    @Schema(description = "角色code")
    @TableField("role_code")
    @NotBlank(message = "角色code不能为空")
    private String roleCode;
    @Schema(description = "角色描述")
    @TableField("description")
    private String description;
}